package pl.freetimetool.domain;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;

@Entity
@Table(name = "holidayrequests")
public class HolidayRequest {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;

	@Basic
	@NotNull
	@DateTimeFormat(iso = ISO.DATE_TIME)
	private Date dispatchDate = new Date();

	@Basic
	@NotNull
	@DateTimeFormat(iso = ISO.DATE_TIME)
	private Date changeStatusDate = new Date();

	@Basic
	@NotNull
	@DateTimeFormat(pattern="dd-mm-yy")
	private Date holidaysStartDate;

	@Basic
	@NotNull
	@DateTimeFormat(pattern="dd-mm-yy")
	private Date holidaysEndDate;

	@Basic
	@NotNull
	private Boolean status;

	public Account getAccount() {
		return this.account;
	}

	public void setAccount(final Account account) {
		this.account = account;
	}

	@Basic
	@NotNull
	@Size(min = 3, max = 45)
	private String kind;

	@ManyToOne(targetEntity = Account.class)
	private Account account;

	public Integer getId() {
		return this.id;
	}

	public void setId(final Integer holidayRequestId) {
		this.id = holidayRequestId;
	}

	public Date getDispatchDate() {
		return this.dispatchDate;
	}

	public void setDispatchDate(final Date dispatchDate) {
		this.dispatchDate = dispatchDate;
	}

	public Date getChangeStatusDate() {
		return this.changeStatusDate;
	}

	public void setChangeStatusDate(final Date changeStatusDate) {
		this.changeStatusDate = changeStatusDate;
	}

	public Date getHolidaysStartDate() {
		return this.holidaysStartDate;
	}

	public void setHolidaysStartDate(final Date holidaysStartDate) {
		this.holidaysStartDate = holidaysStartDate;
	}

	public Date getHolidaysEndDate() {
		return this.holidaysEndDate;
	}

	public void setHolidaysEndDate(final Date holidaysEndDate) {
		this.holidaysEndDate = holidaysEndDate;
	}

	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(final Boolean status) {
		this.status = status;
	}

	public String getKind() {
		return this.kind;
	}

	public void setKind(final String kind) {
		this.kind = kind;
	}
}
